#include <iostream>
using namespace std;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  for (cin >> T; T; T--) {
    int n;

    cin >> n;
    cout << "2 1 " << n << "\n";
    cout.flush();

    int len;

    cin >> len;
    len -= n * (n + 1) / 2;

    int ll = 1, rr = n;

    while (ll < rr) {
      int mm = (ll + rr) >> 1;
      int x, y;
      cout << "1 1 " << mm << "\n";
      cout.flush();
      cin >> x;
      cout << "2 1 " << mm << "\n";
      cout.flush();
      cin >> y;
      if (x != y) {
        rr = mm;
      } else {
        ll = mm + 1;
      }
    }
    cout << "! " << ll << " " << ll + len - 1 << "\n";
    cout.flush();
  }
  return 0;
}